package com.heima.test01;

public class Man {
    private int age;
    private String name;
    private Woman woman;

    public Man() {
    }

    public Man(int age, String name, Woman woman) {
        this.age = age;
        this.name = name;
        this.woman = woman;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Woman getWoman() {
        return woman;
    }

    public void setWoman(Woman woman) {
        this.woman = woman;
    }

    public void ManInfo(){
        System.out.println(name + "的老婆"+woman.getName()+"的年龄是"+woman.getAge() );
    }

}
